/**
 * File: Driver.java
 * Author: Eliana Feasley and Mark pallone
 * Emails: elf4@umbc.edu , markpa1@umbc.edu
 * Date: Jun 19, 2011
 * 
 * Description: Runs through the TreatTrainer program
 *  
 */

package control;
import java.util.ArrayList;
import java.util.Scanner;

import store.MarylandTaxCalculator;
import store.TaxCalculator;
import store.*;

import model.*;
import data.*;
 
public class Driver {
	private static String[] stationChoice = {"Register", "Kitchen", "Quit"};
	private static String[] storeChoice = {"Baskin Robbins", "Dunkin Donuts", "Joint Store"};
	private static String[] stateChoice = {"MD", "VA", "DE"};
	private static TaxCalculator calc;
	
	public static void main(String[] args){
		
		
		int state = Menu.getMenuOption("What state are you in?", stateChoice);
		int store_type = Menu.getMenuOption("What kind of store is this?", storeChoice);
		// When there are more states, make switch statement
		switch(state) {
			case 0:
				calc = new MarylandTaxCalculator();
			case 1:
				calc = new VirginiaTaxCalculator();
			case 2:
				calc = new DelewareTaxCalculator();
		}
		
		try {
			ArrayList<Treat> treats = new ArrayList<Treat>();
			int choice = -1;
			while (choice != 2){
					choice = Menu.getMenuOption("Please Choose a Stations", stationChoice);
					if (choice == 0){
						Station s = new BRRegister(treats, calc);
						if (store_type == 0)
							s = new BRRegister(treats, calc);
						else if (store_type == 1)
							s = new DDRegister(treats, calc);
						else
							s = new JointRegister(treats, calc);
						s.run();
					}
					if (choice == 1)
					{
						Station s = new KitchenStation(treats, calc);						
						s.run();
					}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}